import { API_DOMAINS, http } from '@/http/request/alova'

// 雪具参数
export interface SnowboardBasic {
	id: number
	name: string
	brand: any
	series: any
	model: string
	type: string
	[key: string]: any
}

// 获取雪具列表
export function getSnowboardList(params?: any) {
	return http.Get<Record<string, any>>('/api/equipment/index', {
		params,
		meta: { domain: API_DOMAINS.SECONDARY }, // 用于切换请求地址
	})
}

// 新增雪具
export function addSnowboard(data: AnyObject) {
	return http.Post<SnowboardBasic>('/api/Equipment/add', data)
}

// 获取雪具品牌、系列下拉数据
export function getSnowboardSelect(params?: any) {
	return http.Get<Record<string, any>>('/api/equipment/select', {
		params,
		meta: { domain: API_DOMAINS.SECONDARY }, // 用于切换请求地址
	})
}
